/*!
 * NOTICE OF LICENSE
 * 
 * @author    202 ecommerce <tech@202-ecommerce.com>
 * @author    Mondial Relay
 * @copyright Copyright (c) Mondial Relay
 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 */!function(e){var n={};function r(t){if(n[t])return n[t].exports;var a=n[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,n){if(1&n&&(e=r(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var a in e)r.d(t,a,function(n){return e[n]}.bind(null,a));return t},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.p="",r(r.s=12)}({0:function(e,n,r){"use strict";r.d(n,"d",(function(){return i})),r.d(n,"c",(function(){return s})),r.d(n,"b",(function(){return u})),r.d(n,"a",(function(){return _})),r.d(n,"e",(function(){return c}));var t=r(2);function a(e,n){return function(e){if(Array.isArray(e))return e}
/**
 * NOTICE OF LICENSE
 *
 * @author    202 ecommerce <tech@202-ecommerce.com>
 * @author    Mondial Relay
 * @copyright Copyright (c) Mondial Relay
 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 */(e)||function(e,n){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var t,a,o,i,l=[],d=!0,c=!1;try{if(o=(r=r.call(e)).next,0===n){if(Object(r)!==r)return;d=!1}else for(;!(d=(t=o.call(r)).done)&&(l.push(t.value),l.length!==n);d=!0);}catch(e){c=!0,a=e}finally{try{if(!d&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return o(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=Array(n);r<n;r++)t[r]=e[r];return t}var i=function(){for(var e=0,n=Object.entries(MONDIALRELAY_CARRIER_METHODS);e<n.length;e++){var r=a(n[e],2),t=r[0],o=r[1];(["ES","IT","PT"].includes(MONDIALRELAY_COUNTRY_ISO)&&"IP"!==o.delivery_type||!["ES","IT","PT"].includes(MONDIALRELAY_COUNTRY_ISO)&&"MR"!==o.delivery_type||!MONDIALRELAY_ADDRESS_OPC)&&(o=$('[name^="delivery_option"][value="'+t+',"]')[0])&&l(o,d)}},l=function(e,n){var r;(r=e.closest(".delivery-option")||e.closest(".delivery_option"))&&n(r)},d=function(e){e.remove()},c=t.a,s=function(){return MONDIALRELAY_NATIVE_RELAY_CARRIERS_IDS.includes(u())},u=function(){var e=$('[name^="delivery_option"]:checked').val();if(void 0!==e){var n=e.split(",");e=n[0]}return e||!1},_=function(e){return MONDIALRELAY_CARRIER_METHODS[e]?MONDIALRELAY_CARRIER_METHODS[e].delivery_mode:null};$(document).ready((function(){i()})),$(document).on("click",c.save_button,(function(e){e.preventDefault(),e.stopPropagation(),c.displayErrors(null),$(c.summary_container).empty().show(),c.addLoader(c.summary_container),$(c).trigger("mondialrelay.saveSelectedRelay.before");var n={ajax:!0,action:"saveSelectedRelay",mondialrelay_selectedRelay:MONDIALRELAY_SELECTED_RELAY_IDENTIFIER||0,mondialrelay_selectedRelay_infos:MONDIALRELAY_SELECTED_RELAY_INFOS||[],id_carrier:u()};return $.ajax({type:"POST",url:MONDIALRELAY_AJAX_CHECKOUT_URL,data:n,dataType:"json",success:function(e){if(e){if("ok"!=e.status)return c.savedRelay=null,e.error.length&&c.displayErrors(e.error),c.removeLoader($(c.summary_container)),void $(c).trigger("mondialrelay.saveSelectedRelay.error");c.savedRelay=MONDIALRELAY_SELECTED_RELAY_IDENTIFIER,$(c.summary_container).html(e.content.relaySummary),c.hide(),$(c.save_container).hide(),$(c.widget_container).slideUp(),$(c.save_container).slideUp(),$(c).trigger("mondialrelay.saveSelectedRelay.success")}else this.error(e)},error:function(e){c.savedRelay=null,alert(MONDIALRELAY_SAVE_RELAY_ERROR),$(c).trigger("mondialrelay.saveSelectedRelay.error"),c.removeLoader($(c.summary_container))}}),!1}));var y=function(){var e=u();if(e){var n=_(e);if(n)$("#mondialrelay_save-container").show(),$(".mondialrelay_save-relay").hide().removeAttr("id"),$('.mondialrelay_save-relay[data-mr-mode="'.concat(n,'"]')).attr("id","mondialrelay_save-relay").show();else $("#mondialrelay_save-container").hide()}};$(document).ready((function(){y(),prestashop.on("updatedDeliveryForm",(function(){y()}))}))},12:function(e,n,r){"use strict";r.r(n);var t=r(0),a=!1,o=function(){$.ajax({type:"POST",headers:{"cache-control":"no-cache"},url:orderOpcUrl+"?rand="+(new Date).getTime(),async:!0,cache:!1,dataType:"json",data:"ajax=true&method=getAddressBlockAndCarriersAndPayments&token="+static_token,success:function(e){if(e.hasError){var n="";for(var r in e.errors)"indexOf"!==r&&(n+=$("<div />").html(e.errors[r]).text()+"\n");alert(n)}else void 0!==e.formatedAddressFieldsValuesList&&e.formatedAddressFieldsValuesList&&(formatedAddressFieldsValuesList=e.formatedAddressFieldsValuesList),void 0!==e.order_opc_adress&&e.order_opc_adress&&($(".opc-main-block .addresses").html($($.parseHTML("<div>"+e.order_opc_adress+"</div>")).find(".opc-main-block .addresses").contents()),updateAddressesDisplay(!0),"undefined"!=typeof bindUniform&&bindUniform())},error:function(e,n,r){}})};
/**
 * NOTICE OF LICENSE
 *
 * @author    202 ecommerce <tech@202-ecommerce.com>
 * @author    Mondial Relay
 * @copyright Copyright (c) Mondial Relay
 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 */$(t.e).on("mondialrelay.ready",(function(){t.c()&&(a=!0,t.e.savedRelay?($(t.e.summary_container).show(),t.e.hide()):($("#HOOK_PAYMENT").empty(),updatePaymentMethodsDisplay(),t.e.show()),t.e.init({ColLivMod:t.a(t.b())}))})),$(document).on("mondialrelay.contentRefreshed","#mondialrelay_content",(function(e,n){t.d(),n.fromAjax&&(t.e.initialized=!1,t.e.savedRelay=MONDIALRELAY_SELECTED_RELAY_IDENTIFIER,t.c()?(t.e.savedRelay?($(t.e.save_button).click(),t.e.hide()):t.e.show(),t.e.initOrUpdate({ColLivMod:t.a(t.b())}),a=!0):(a&&o(),t.e.hide(),a=!1))})),$(t.e).on("mondialrelay.saveSelectedRelay.before",(function(){$("#HOOK_PAYMENT").empty()})),$(t.e).on("mondialrelay.saveSelectedRelay.success",(function(){updatePaymentMethodsDisplay(),o()})),$(t.e).on("mondialrelay.saveSelectedRelay.error",(function(){updatePaymentMethodsDisplay(),o()}))},2:function(e,n,r){"use strict";r.d(n,"a",(function(){return t}));
/**
 * NOTICE OF LICENSE
 *
 * @author    202 ecommerce <tech@202-ecommerce.com>
 * @author    Mondial Relay
 * @copyright Copyright (c) Mondial Relay
 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 */
var t={url:"//widget.mondialrelay.com/parcelshop-picker/jquery.plugin.mondialrelay.parcelshoppicker.min.js",loaded:!1,initialized:!1,widget_container:"#mondialrelay_widget",save_container:"#mondialrelay_save-container",error_container:"#mondialrelay_errors",summary_container:"#mondialrelay_summary",save_button:".mondialrelay_save-relay",change_button:"#mondialrelay_change-relay",selected_relay_input:"#mondialrelay_selected-relay",widget_search_zipcode_input:"#mondialrelay_widget .MRW-Search .Arg2",widget_search_country_input:"#mondialrelay_widget .MRW-Search .Arg1",savedRelay:null,widget_current_params:null};t.load=function(e){!function(e,n){var r=document.createElement("script");r.onload=n,r.src=e,document.head.appendChild(r)}(t.url,(function(){t.loaded=!0,e()}))},t.init=function(e){if("undefined"==typeof MONDIALRELAY_BAD_CONFIGURATION||!MONDIALRELAY_BAD_CONFIGURATION){if(t.savedRelay&&$(t.summary_container).slideDown(),!t.loaded)return t.addLoader(t.widget_container),void t.load((function(){t.init(e)}));var n={Target:t.selected_relay_input,Brand:MONDIALRELAY_ENSEIGNE,Country:MONDIALRELAY_COUNTRY_ISO,PostCode:MONDIALRELAY_POSTCODE,ShowResultsOnMap:1==MONDIALRELAY_DISPLAY_MAP,NbResults:"7",Responsive:!0,WidgetLanguage:MONDIALRELAY_LANG_ISO,OnParcelShopSelected:function(e){$(t.save_container).show(),t.setSelectedRelay(null,e)}};n.Theme=["ES","IT","PT"].includes(MONDIALRELAY_COUNTRY_ISO)?"inpost":"mondialrelay",e&&$.extend(n,e),t.widget_current_params=n,$(t.widget_container).MR_ParcelShopPicker(n),t.initialized=!0}},t.show=function(){$(t.widget_container).show()},t.hide=function(){$(t.widget_container).hide()},t.update=function(e){$(t.widget_container).trigger("MR_SetParams",e),t.widget_current_params=$.extend(t.widget_current_params,e),t.doSearch()},t.initOrUpdate=function(e){t.initialized?t.update(e):t.init(e)},t.setSelectedRelay=function(e,n){if(window.MONDIALRELAY_SELECTED_RELAY_INFOS=n,void 0!==e&&e||(e=$(t.selected_relay_input).val()),e==$(t.selected_relay_input).val()&&MONDIALRELAY_SELECTED_RELAY_IDENTIFIER!=e){var r=MONDIALRELAY_SELECTED_RELAY_IDENTIFIER;MONDIALRELAY_SELECTED_RELAY_IDENTIFIER=e,$(t).trigger("mondialrelay.selectedRelay",{oldRelay:r,relayData:n})}},t.resetSelectedRelay=function(){var e=MONDIALRELAY_SELECTED_RELAY_IDENTIFIER;MONDIALRELAY_SELECTED_RELAY_IDENTIFIER=null,window.MONDIALRELAY_SELECTED_RELAY_INFOS=[],$(t).trigger("mondialrelay.selectedRelay",{oldRelay:e,relayData:null})},t.resetSavedRelay=function(e){t.savedRelay=null,void 0!==e&&e||($(t.summary_container).slideUp(),$(t.widget_container).slideDown(),$(t.save_container).slideDown())},t.doSearch=function(e,n){var r=[void 0!==e&&e?e:$(t.widget_search_zipcode_input).val(),void 0!==n&&n?n:$(t.widget_search_country_input).val()];$(t.widget_container).trigger("MR_DoSearch",r)},t.displayErrors=function(e){var n=$(t.error_container);0!=n.length&&(n.stop(!0),n.children().length&&n.fadeOut((function(){$(this).empty()})),void 0!==e&&e&&(n.queue((function(){var n=[];$.each(e,(function(e,r){n.push($("<div/>").addClass("alert alert-danger").text(r))})),$(this).append(n),$(this).dequeue()})),n.fadeIn()))},t.addLoader=function(e){0!=$(e).length&&($(e).children(".mondialrelay_loader").length>0||$("#mondialrelay_loader-template").clone().attr("id",null).show().appendTo(e))},t.removeLoader=function(e){$(e).children(".mondialrelay_loader").remove()},$(document).ready((function(){t.savedRelay=MONDIALRELAY_SELECTED_RELAY_IDENTIFIER,$(t).trigger("mondialrelay.ready")})),$(document).on("click",t.change_button,(function(e){t.show()})),$(document).on("click",".MRW-ShowList",(function(e){e.preventDefault(),e.stopPropagation()})),$(document).on("click",".PR-City",(function(e){e.preventDefault(),e.stopPropagation()}))}});